import { createBrowserRouter } from 'react-router-dom';
import App from '../App';
import Counter from '../pages/Counter';
import ShoppingCart from '../pages/shopping-cart';

export const routerPaths = {
  // home page
  home: '/',
  // 购物车 demo
  shoppingCart: 'shoppingCart',
  // counter with reducer
  counter: 'counter',
};

const router = createBrowserRouter([
  {
    path: routerPaths.home,
    element: <App />,
  },
  {
    path: routerPaths.shoppingCart,
    element: <ShoppingCart />,
  },
  {
    path: routerPaths.counter,
    element: <Counter />,
  },
]);

export default router;
